*--------------------------------------------------------------------------------------------------------*
* The Illusory End of Stop-and-Frisk in Chicago?							                             *
* David Hausman and Dorothy Kronick					                                                     *
* Last modification: 7/18/2023                                                                           *
* Version of Stata: Stata MP 17.0                                                  		                 *
* ------------------------------------------------------------------------------------------------------ *                    
* Additional programs needed:                                                     					     *
* 1.) binsreg (https://nppackages.github.io/binsreg/) can be obtained by running:                        *
* net install binsreg, from(https://raw.githubusercontent.com/nppackages/binsreg/master/stata) replace   *
* 2.) reghdfe can be obtained by running "ssc install reghdfe, replace"                                  *
* 3.) ftools is needed by reghdfe. Can be obtained by running "ssc install ftools, replace"              *
* 4.) renvars can be obtained by running "findit renvars".                                               *
* 5.) savesome can be obtained by running "ssc install savesome, replace"                                *
*--------------------------------------------------------------------------------------------------------*


*------------------------------*
* 1.) CHOOSE working directory *
*------------------------------*
* Define a working directory
* User should choose the directory where the folder was unzipped
cd "/Users/kronick/CPD"	
	
	
*-------------------*
* 2.) Preliminaries *
*-------------------*
clear
clear all
cap log close
set more off, perm

* Deleting generated data files, figures
* so that everything is freshly produced
foreach x in "data/outputs" "figures" {
	cap mkdir "`x'"
	local files: dir "`x'" files *
	foreach file of local files {
	        rm "`x'/`file'"
	}
}


*---------------------*
* 3.) Data generation *
*---------------------*
	* Code that uses the raw data in data/inputs to produce the
	* intermediate data sets that we use in the analysis.
	do "code/01_ISRData.do"
	do "code/02_TrafficStopData.do"
	do "code/03_ContactCardData.do"

	
*-------------*
* 4.) Figures *
*-------------*
	
	do "code/04_Figure1.do"
	do "code/05_Figure2.do"
	do "code/06_Figure3.do"
	do "code/07_Figure4.do"
	do "code/08_Figure5.do"
	
	do "code/09_FigureS1.do"
	do "code/10_FigureS2.do"
	do "code/11_FigureS3.do"
	do "code/12_FigureS4.do"
	do "code/13_FigureS5.do"


*------------------------------------------------------------------------------*
clear all
